/*!
 * \file OdiohPlaya.h
 * \brief Audio Player for Linux 
 * \author Joao Guerreiro
 * \date December 2, 2010
 */

#ifndef _ODIOHPLAYA_H
#define	_ODIOHPLAYA_H

#include <QtGui>
#include <QMainWindow>
#include <QList>
#include <QGtkStyle>
#include <QToolTip>


#include <phonon/audiooutput.h>
#include <phonon/seekslider.h>
#include <phonon/mediaobject.h>
#include <phonon/volumeslider.h>
#include <phonon/backendcapabilities.h>

#include "ui_OdiohPlaya.h"

#include <iostream>
#include <sstream>
#include <algorithm>

using namespace std;

/*!
 * Main widget 
 */
class OdiohPlaya : public QMainWindow {
    Q_OBJECT
public:
    OdiohPlaya();
    virtual ~OdiohPlaya();

protected:

    //for dropping tracks onto the widget
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);


private slots:

    void addTracks();
    void nextTrack();
    void previousTrack();
    void trackFinished();
    void updateTime();
    void playPause();
    void stopPlayback();
    void rowDoubleClicked(int row, int column);
    void removeTracks(); //remove a selection of tracks
    void clearTrackList(); //remove all the tracks
    void changeVolume(int);

private:
    Ui::OdiohPlaya widget;
    Phonon::MediaObject *mediaObject; //control files to be played
    Phonon::AudioOutput *audioOutput; //control sound output
    QList<Phonon::MediaSource> sources; //list of tracks
    int currentTrack; //current track playing
};

#endif	/* _ODIOHPLAYA_H */
